package com.zhijiaoyun.dao;

import com.zhijiaoyun.dao.core.IBaseDao;
import com.zhijiaoyun.model.CourseHistory;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author shisfish
 * @date 2017/6/6
 */
public interface ICourseHistoryDao extends IBaseDao<CourseHistory> {

    /**
     * get by courseId and userId
     *
     * @param courseId
     * @param userId
     * @return
     */
    CourseHistory selectByCourseIdUserId(@Param("courseId") Long courseId, @Param("userId") Long userId);

    /**
     * count by params
     *
     * @param userId
     * @return
     */
    int countByParams(@Param("userId") Long userId);

    /**
     * page by params
     *
     * @param beginIndex
     * @param pageSize
     * @param userId
     * @return
     */
    List<CourseHistory> pageByParams(@Param("beginIndex") int beginIndex, @Param("pageSize") int pageSize, @Param("userId") Long userId);

    /**
     * list by userId
     *
     * @param beginIndex
     * @param pageSize
     * @param userId
     * @return
     */
    List<CourseHistory> selectByUserId(@Param("beginIndex") int beginIndex, @Param("pageSize") int pageSize, @Param("userId") Long userId);
}